#ifndef GlobalsH
#define GlobalsH

  #include <vcl.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <conio.h>
  #include <dir.h>


  #define _free( x ) if ( x ) { free( x ); x = NULL; }


  #define readw( x ) ( fgetc( x ) + (fgetc(x) << 8) )
  #define WRAM( x ) *(WORD *)&ram[ x ]
  #define LRAM( x ) *(LONG *)&ram[ x ]
  #define WGET( x, y ) *(LONG *)&x[ y ]  

  typedef struct _REGZ
  { //
    WORD y,
         x,
         a;
    BYTE stack;
  } REGZ;

  extern REGZ reg;  
  extern BYTE *rom;
  extern BYTE *ram;
  extern FILE *rf;
  extern FILE *df;
  extern BYTE buf[4][32];
  extern char romf[MAXPATH];
  extern char datf[MAXPATH];
  extern char dirc[MAXPATH];  

  extern WORD valu;
  extern WORD z;
  extern LONG FSize;

  extern LONG Snes2Pc( LONG ofs );
  extern LONG FileSize( FILE *tf );

#endif
